package com.kinggm.service.decorator.abs.impl;

import com.kinggm.service.decorator.abs.Beverage;
import com.kinggm.service.decorator.abs.CondimentDecorator;

public class Mocha extends CondimentDecorator {

    Beverage berevage;

    public Mocha(Beverage berevage) {
        this.berevage = berevage;
    }


    @Override
    public String getSize() {
        return berevage.getSize();
    }

    @Override
    public double cost() {
       switch (berevage.getSize()) {
           case "大杯":
               return 2 + berevage.cost();
           case "中杯":
               return 1.5 + berevage.cost();
           case "小杯":
               return 1 + berevage.cost();
           default:
               return 0;
       }
    }


    @Override
    public String getDescription() {
        return berevage.getDescription() + ", 抹茶";
    }
}
